<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>流程控制-循环结构</title>
</head>
<body>
    <h1>流程控制-循环结构</h1>

    {% for item in items %}
        {{item}}<br>
    {% endfor %}
    <hr>

    {{ person }} <br>
    {{ person.uname }}<br>
    {% for p in person.keys() %}
        {{ p }}
    {% endfor %}<br>

    {% for p in person.values() %}
        {{ p }}
    {% endfor %}<br>

    {% for p in person.items() %}
        {{ p }}
    {% endfor %}<br>

    <hr>

    {% for item in items %}
        {{item}} == {{ loop.index }} =={{ loop.index0 }} == {{loop.first}}=={{ loop.last }} == {{loop.length}}<br>
    {% endfor %}

    <hr>

    <!-- 反向遍历 -->
    {% for item in items|reverse %}
        {{item}}<br>
    {% endfor %}
</body>
</html>